package com.allprs.hmcs.service.impl;

import com.allprs.common.core.domain.AjaxResult;
import com.allprs.common.utils.StringUtils;
import com.allprs.hmcs.entity.NaturalWater;
import com.allprs.hmcs.entity.Shelters;
import com.allprs.hmcs.mapper.SheltersMapper;
import com.allprs.hmcs.pojo.reqBo.SheltersQueryBo;
import com.allprs.hmcs.service.ISheltersService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author wjf
 * @描述:
 * @date 2024年06月12日
 * @version: 1.0
 */

@Service
public class SheltersServiceImpl implements ISheltersService {

    @Resource
    private SheltersMapper sheltersMapper;

    @Override
    public AjaxResult getSheltersInfo(SheltersQueryBo queryBo) {
        QueryWrapper<Shelters> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq(StringUtils.isNotBlank(queryBo.getName()), "name", queryBo.getName());
        List<Shelters> naturalWaters = sheltersMapper.selectList(queryWrapper);

        return AjaxResult.success(naturalWaters);
    }
}
